#ifndef __CLI_PARSE__ROOM_H__
#define __CLI_PARSE__ROOM_H__

#include "structs.h"
#include "../../Epsilon/Epsilon3D/vcache.h"

#include "../../Epsilon/STL.h"
#include <vector>

namespace cli_parse {
  class Actor;
  class RenderBatch;
};

namespace Underlight
{
  class Level;
  class Sector;

  class Room //: public Epsilon::Node
  {
  public:
    Room (void);
    Room (int id_);

    virtual ~Room (void);

    void    AddSector      (Sector* sector);
    bool    ContainsSector (int id) const;
    Sector* GetSector      (int id) const;
    //Actor*  GetActor       (int id) const;

    bool    Load           (Underlight::Level* lvl);
    void    Unload         (void);

    void    AddBatches  (Sector* sector);
    void    SortBatches (void);

    size_t MemSize (void);

  //private:
    int          id;
    char         name [ROOM_NAME_SIZE];
    short        background, background_palette;
    unsigned int flags;

    bool         loaded;

    e3dBoundingBox bound;

    std::vector<Sector*> sectors;

    std::vector<cli_parse::RenderBatch*> batches;
    std::vector<cli_parse::RenderBatch*> animated_batches;

    e3dVertexCache* vcache;
    e3dIndexCache*  icache;
  };
};

#endif /* __CLI_PARSE__ROOM_H__ */